[API] Baggage - Trim white spaces and check for semi colon which isn't allowed octet#7009
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7009 +/- ##
==========================================
+ Coverage 88.79% 88.83% +0.03%
==========================================
Files 271 271
Lines 12970 12976 +6
==========================================
+ Hits 11517 11527 +10
+ Misses 1453 1449 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Please add a CHANGELOG entry. |
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
Benchmark Results SummaryCompleted benchmarks with changes
Raw DataBefore my changes: After my changes @martincostello One other thing, I was looking at how the benchmarking is working. Execution Summary
|
|
If the code path you're touching isn't benchmarked, then let's add another that deals with that path. |
Benchmark changesI changed how the baggageHeader is being built, keys and values need to be trimmed now and semicolon needs to be removed Raw DataAfter my changes Before my changes These two rows are standouts: Interestingly mean time after my changes has decreased, I thought this would be a slight deterioration. |
…s.cs Co-authored-by: Martin Costello <martin@martincostello.com>
….3 (#1015) Updated [OpenTelemetry.Exporter.OpenTelemetryProtocol](https://github.com/open-telemetry/opentelemetry-dotnet) from 1.15.2 to 1.15.3. <details> <summary>Release notes</summary> _Sourced from [OpenTelemetry.Exporter.OpenTelemetryProtocol's releases](https://github.com/open-telemetry/opentelemetry-dotnet/releases)._ ## 1.15.3 For highlights and announcements pertaining to this release see: [Release Notes > 1.15.3](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/RELEASENOTES.md#1153). The following changes are from the previous release [1.15.2](https://github.com/open-telemetry/opentelemetry-dotnet/releases/tag/core-1.15.2). * NuGet: [OpenTelemetry v1.15.3](https://www.nuget.org/packages/OpenTelemetry/1.15.3) * Fix resource leak in batch and periodic exporting task workers for Blazor/WASM. ([#7069](open-telemetry/opentelemetry-dotnet#7069)) * Fixed `LogRecord.LogLevel` to preserve `LogLevel.None` and handle unspecified or out-of-range severities without returning invalid enum values. ([#7092](open-telemetry/opentelemetry-dotnet#7092)) * Fixed `OTEL_TRACES_SAMPLER_ARG` handling to treat out-of-range, `NaN`, and infinite values as invalid and fall back to the default ratio when using `traceidratio` and `parentbased_traceidratio` samplers. ([#7103](open-telemetry/opentelemetry-dotnet#7103)) See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet/blob/core-1.15.3/src/OpenTelemetry/CHANGELOG.md) for details. * NuGet: [OpenTelemetry.Api v1.15.3](https://www.nuget.org/packages/OpenTelemetry.Api/1.15.3) * Fix baggage and trace headers not respecting the maximum length in some cases. ([#7061](open-telemetry/opentelemetry-dotnet#7061)) * Improve efficiency of parsing of baggage and B3 propagation headers. ([#7061](open-telemetry/opentelemetry-dotnet#7061)) * **Breaking change:** Fixed `tracestate` parsing to reject keys that do not begin with a lowercase letter, including keys beginning with digits, to align with the W3C Trace Context specification. ([#7065](open-telemetry/opentelemetry-dotnet#7065)) * Fixed `BaggagePropagator` to trim optional whitespace (OWS) around `=` separators when parsing the `baggage` header, as required by the [W3C Baggage specification](https://www.w3.org/TR/baggage/). ([#7009](open-telemetry/opentelemetry-dotnet#7009)) * Fixed `BaggagePropagator` to strip baggage properties (e.g. `;metadata`) from values when parsing the `baggage` header. ([#7009](open-telemetry/opentelemetry-dotnet#7009)) See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet/blob/core-1.15.3/src/OpenTelemetry.Api/CHANGELOG.md) for details. * NuGet: [OpenTelemetry.Api.ProviderBuilderExtensions v1.15.3](https://www.nuget.org/packages/OpenTelemetry.Api.ProviderBuilderExtensions/1.15.3) No notable changes. See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet/blob/core-1.15.3/src/OpenTelemetry.Api.ProviderBuilderExtensions/CHANGELOG.md) for details. ... (truncated) ## 1.15.3-beta.1 The following changes are from the previous release [1.15.2-beta.1](https://github.com/open-telemetry/opentelemetry-dotnet/releases/tag/coreunstable-1.15.2-beta.1). * NuGet: [OpenTelemetry.Exporter.Prometheus.AspNetCore v1.15.3-beta.1](https://www.nuget.org/packages/OpenTelemetry.Exporter.Prometheus.AspNetCore/1.15.3-beta.1) * Fixed metric unit strings containing invalid Prometheus characters (e.g. `# RU`) not being sanitized, resulting in malformed metric names. ([#6187](open-telemetry/opentelemetry-dotnet#6187)) * Fixed Prometheus metric serialization to handle empty label names without throwing during scrape rendering. ([#7077](open-telemetry/opentelemetry-dotnet#7077)) * Updated OpenTelemetry core component version(s) to `1.15.3`. ([#7125](open-telemetry/opentelemetry-dotnet#7125)) See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet/blob/coreunstable-1.15.3-beta.1/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/CHANGELOG.md) for details. * NuGet: [OpenTelemetry.Exporter.Prometheus.HttpListener v1.15.3-beta.1](https://www.nuget.org/packages/OpenTelemetry.Exporter.Prometheus.HttpListener/1.15.3-beta.1) * Fixed metric unit strings containing invalid Prometheus characters (e.g. `# RU`) not being sanitized, resulting in malformed metric names. ([#6187](open-telemetry/opentelemetry-dotnet#6187)) * Fixed Prometheus metric serialization to handle empty label names without throwing during scrape rendering. ([#7077](open-telemetry/opentelemetry-dotnet#7077)) * Updated OpenTelemetry core component version(s) to `1.15.3`. ([#7125](open-telemetry/opentelemetry-dotnet#7125)) See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet/blob/coreunstable-1.15.3-beta.1/src/OpenTelemetry.Exporter.Prometheus.HttpListener/CHANGELOG.md) for details. * NuGet: [OpenTelemetry.Shims.OpenTracing v1.15.3-beta.1](https://www.nuget.org/packages/OpenTelemetry.Shims.OpenTracing/1.15.3-beta.1) * Fixes support for `byte`, `short`, `int`, and `float` attributes. ([#7080](open-telemetry/opentelemetry-dotnet#7080)) * Updated OpenTelemetry core component version(s) to `1.15.3`. ([#7125](open-telemetry/opentelemetry-dotnet#7125)) See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet/blob/coreunstable-1.15.3-beta.1/src/OpenTelemetry.Shims.OpenTracing/CHANGELOG.md) for details. Commits viewable in [compare view](open-telemetry/opentelemetry-dotnet@core-1.15.2...core-1.15.3). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Towards #6816, #5210
Changes
BaggagePropagatorto trim optional whitespace (OWS) around=separatorswhen parsing the
baggageheader, as required by theW3C Baggage specification. This caused
incompatibility with .NET 10's default W3C propagator, which emits headers with
OWS (e.g.
key = value), resulting in spaces being URL-encoded as+inoutbound headers received by downstream services.
BaggagePropagatorto strip baggage properties (;metadata) from valueswhen parsing the
baggageheader. Semicolon is not a validbaggage-octetperthe W3C Baggage specification and must be interpreted as the start of a property,
not part of the value.
(#5210)
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changesI don't think this is non-trivial but let me know if I need to do this